package top.kaoshanji.p2ch17a;

import top.kaoshanji.y1constant.FileConstant;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * 代码清单-p2ch17a-543页a：读取文件的所有行
 * author kaoshanji
 * ^_^
 * create time 2025/3/11 17:29
 */
public class ListOfLines {

    public static void main(String[] args) throws IOException {

        Files.readAllLines(Paths.get(FileConstant.LOCAL_ROOT_PATH.concat("p2ch17a543页a\\Cheese.dat")))
                .stream()
                .filter(line -> !line.startsWith("//"))
                .map(line -> line.substring(0, line.length()/2))
                .forEach(System.out::println);

    }


}
